package com.dony.web.controller.local;

import com.dony.common.core.controller.BaseController;
import com.dony.common.core.domain.AjaxResult;
import com.dony.shop.service.ILocalShopItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 本土店铺商品Controller
 *
 * @author sundw
 * @date 2022-08-31
 */
@RestController
@RequestMapping("/local/shop/item")
public class LocalShopItemController extends BaseController
{
    @Autowired
    private ILocalShopItemService localShopItemService;


    /**
     * 获取商品详细信息
     */
    @PostMapping(value = "/{shopId}/{itemId}")
    public AjaxResult getItemBaseInfo(@PathVariable("shopId") Long shopId,@PathVariable("itemId") Long itemId)
    {
        return AjaxResult.success(localShopItemService.getItemFromShopee(shopId,itemId));
    }

    /**
     * 获取商品详细信息
     */
    @PostMapping(value = "/add")
    public AjaxResult add()
    {
        return AjaxResult.success(localShopItemService.addLocalItemBatch());
    }



}
